home *** CD-ROM | disk | FTP | other *** search
/ Delphi Developer's Kit 1996 / Delphi Developer's Kit 1996.iso / power / timetest / read.me next >
Text File  |  1995-12-22  |  2KB  |  51 lines

  1.  
  2. The I/O Checking Check Box Mystery
  3.  
  4.  
  5. This little form was meant to be used to compare various
  6. string search strategies and other performance enhancing opportunities.
  7.  
  8. While experimenting with the effects of turning on and off the various
  9. run time error checking options, a funny thing happened.
  10.  
  11. With I/O Checking checked, execution time was 2.5 to 3 times faster
  12. than with it unchecked.
  13.  
  14. Adding a {$I+} or {$I-} to the code made no difference. Time and
  15. again I checked and unchecked the box and checking it made a big
  16. difference. NOTHING else was changed.
  17.  
  18. The routines being timed have no I/O in them whatever. One is StrPos
  19. and the other is a similar routine written in assembler.
  20.  
  21. As I was packaging up this little test version for the curious among
  22. you, I rebuilt the project in another directory.
  23.  
  24. Well now I am totally mystified. NOW it works the other way around.
  25.  
  26. Selecting I/O Checking in the Options | Project | Compiler  slows the
  27. program down 2.5 to 3 times. Not selecting it speeds it up. Now this is
  28. more intuitive, except for the fact that there are no I/O routines
  29. inside the timing loops.
  30.  
  31. How did it reverse when I rebuilt everything? Is it possible for Delphi
  32. to lose track of checked vs unchecked? Was something else slowing the
  33. execution down when I checked the box? It happened at least ten times
  34. with Compile|Build between each and every test.
  35.  
  36. OK, it's the next day. I built up the program again and now there
  37. is no difference, checked or unchecked. If I had any hair left, I
  38. would be pulling it out.
  39.  
  40. Anyone got any ideas. Slowing a program down by a factor of 3 is
  41. pretty important when you are about to search a gig or more of
  42. text... If this were an application, I probably wouldn't have noticed
  43. that something was going on.
  44.  
  45. Let me know what you discover. Use the timer to make your own methods
  46. more efficient. Brought to you by the I hate to wait crowd.
  47.  
  48. Peter Jennings
  49. peterj@netcom.com
  50.  
  51.